<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:57:"D:\phpStudy\WWW\auth/application/web\view\show\index.html";i:1496201807;s:58:"D:\phpStudy\WWW\auth/application/web\view\public\base.html";i:1496201802;}*/ ?>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="renderer" content="webkit">
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<title>商家后台管理</title>
		<meta name="keywords" content="">
		<meta name="description" content="">
		<!--[if lt IE 9]>
    	<meta http-equiv="refresh" content="0;ie.html" />
    	<![endif]-->
		<link rel="shortcut icon" href="favicon.ico">
		<link href="__CSS__/bootstrap.min.css" rel="stylesheet">
		<link href="__CSS__/font-awesome.min.css" rel="stylesheet">
		<link href="__CSS__/animate.min.css" rel="stylesheet">
		<link href="__CSS__/style.min.css" rel="stylesheet">
		<link href="__CSS__/admin.css" rel="stylesheet">
	</head>
	<style>
		.lactive {
			background: #293846;
			color: #FFFFFF;
			border-bottom: solid 2px #1ab394
		}
		
		.lactive> a {
			color: #ffffff!important;
		}
	</style>

	<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
		<div id="wrapper">
			<!--左侧导航开始-->
			<div class="navbar_top_nav">
				<ul class="nav navbar-top-links navbar-left">
					<li class="nspecial">
						<span class="block m-t-xs"><strong class="font-bold">
							<?php echo session('storeInfo')['store_name']; if($chainsotrename!==''): ?>
							(<?php echo $chainsotrename; ?>)
							<?php endif; ?>
						</strong></span>
					</li>
					<li class="hidden-xs" id='shouye'>
						<a href="<?php echo url('index/index'); ?>">
							&nbsp;&nbsp;<i class="fa fa-home"></i>首页&nbsp;&nbsp;
						</a>
					</li>
					<?php if(is_array($store_top_menus) || $store_top_menus instanceof \think\Collection): if( count($store_top_menus)==0 ) : echo "" ;else: foreach($store_top_menus as $key=>$st): ?>
					<li id="top_menu<?php echo $st['id']; ?>">
						<a href="/<?php echo $st['name']; ?>?top_menu_id=<?php echo $st['id']; ?>"><i class='<?php echo $st['icon']; ?>'></i><?php echo $st['title']; ?></a>
					</li>
					<?php endforeach; endif; else: echo "" ;endif; ?>
				</ul>
				<ul class="nav navbar-top-links navbar-right">
					<li class="hidden-xs">
						<a href="/help" target="_blank">
							<i class="fa fa-chain"></i>帮助文档
						</a>
					</li>

					<li class="hidden-xs">
							<a data-toggle="dropdown" href="#">
								<i class="fa fa-chain"></i>系统管理<b class="caret"></b>
							</a>
							<ul class="dropdown-menu animated fadeInRight m-t-xs">
								<li>
									<a onclick="jiaoban()" }>
										<i class="fa fa-chain"></i>交班
									</a>
								</li>
								<li class="divider"></li>
								<li>
									<a href="<?php echo url('index/clear'); ?>">
										<i class="fa fa-refresh"></i>清除缓存
									</a>
								</li>
								<li>
									<a href="<?php echo url('login/logout'); ?>"><i class="fa fa-sign-out"></i>退出系统</a>
								</li>
							</ul>
					</li>
				</ul>

			</div>
			<nav class="navbar-default navbar-static-side" role="navigation" style="margin-top: 60px;">

				<div class="sidebar-collapse">
					<ul class="nav" id="side-menu">

						<li class="menu" style="text-align: center; background-color:#08575B;">
							<a class="navbar-minimalize" href="#" style="text-align: center; background-color:#08575B;">
								<i class="fa fa-bars"></i>
							</a>
						</li>
						<?php if(!empty($menu)): if(is_array($menu) || $menu instanceof \think\Collection): if( count($menu)==0 ) : echo "" ;else: foreach($menu as $key=>$vo): ?>
						<li class="menu" style="text-align:left">
							<a href="/<?php echo $vo['name']; ?>?top_menu_id=<?php echo $top_menu_id; ?>">
								<i class="<?php echo $vo['icon']; ?>" style="width: 15px;"></i>
								<span class="nav-label"><?php echo $vo['title']; ?>&nbsp;&nbsp; </span>
							</a>
						</li>
						<?php endforeach; endif; else: echo "" ;endif; endif; ?>
					</ul>
				</div>
			</nav>
			<!--左侧导航结束-->
			<!--右侧部分开始-->
			<div id="page-wrapper" class="gray-bg dashbard-1">
				<div class="row border-bottom" style="display: none;">
					<nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0;">
						<div class="navbar-header">
							<a class="navbar-minimalize " href="#">
							</a>
						</div>

					</nav>
				</div>
				<div class="row" style="margin-top: 66px;">
					
<div class="content-tabs">
	<ol class="breadcrumb">
		<li>
			<a href="<?php echo url('index/index'); ?>"><i class="fa fa-home"></i></a>
		</li>
		<li><strong>商品管理</strong></li>
	</ol>
</div>
<div class="ibox float-e-margins">
	<div class="ibox-content">
		
		<form method="post" action="<?php echo url('index'); ?>">
			<div class="form-group" style="padding-left: 20px;">
				商品编码 <input type="text" id="goods_no" name="goods_no" value="" placeholder="请输入商品编码" class="bank" /> 
				商品名称 <input type="text" id="goods_name" name="goods_name" value="" placeholder="请输入商品名称" class="bank" />
				<span class="bank"><button type="submit" class="btn btn-sm btn-primary"><li class="fa fa-search"> 查询</li></button> </span>
			</div>
		</form>
		<div class="hr-line-dashed"></div>
		<div class="example-wrap">
			<div class="example">
				<table class="table table-bordered table-hover">
					<thead>
						<tr class="long-th">
							<th>商品编码</th>
							<th>商品名称</th>			
							<th>商品单位</th>
							<th>销售价(元)</th>
							<th>库存</th>
							<th>添加时间</th>
							<th style="display:none;">疯狂抢</th>
							<th>赚积分</th>
							<th>优惠购</th>
							<th>云拼团</th>
							<th>交友团</th>
							<th>秒杀</th>
						</tr>
					</thead>
					<tbody>
						<?php if(is_array($list) || $list instanceof \think\Collection): if( count($list)==0 ) : echo "" ;else: foreach($list as $key=>$ad): ?>
						<tr>
							<td class="text-center"><?php echo $ad['goods_no']; ?></td>
							
							<td class="text-center"><?php echo $ad['goods_name']; ?></td>
							<td class="text-center"><?php echo $ad['unit']; ?></td>
							<td class="text-center"><?php echo $ad['sale_price']; ?></td>
							<td class="text-center"><?php echo $ad['stock']; ?></td>
							<td class="text-center"><?php echo $ad['add_time']; ?></td>

							<td class="text-center" style="display:none;">
								<?php if($ad['is_grab']==0): ?>
									<a onclick="isgrab('<?php echo $ad['id']; ?>')" class="btn btn-primary btn-danger">关闭</a>
								<?php else: ?>
									<a onclick="isgrab('<?php echo $ad['id']; ?>')" class="btn btn-primary btn-outline">开启</a>
								<?php endif; ?>
							</td>
							<td class="text-center">
								<?php if($ad['is_score']==0): ?>
									<a onclick="isscore('<?php echo $ad['id']; ?>')" class="btn btn-primary btn-danger">关闭</a>
								<?php else: ?>
									<a onclick="isscore('<?php echo $ad['id']; ?>')" class="btn btn-primary btn-outline">开启</a>
								<?php endif; ?>
							</td>
							<td class="text-center">
								<?php if($ad['is_agio']==0): ?>
									<a onclick="isagio('<?php echo $ad['id']; ?>')" class="btn btn-primary btn-danger">关闭</a>
								<?php else: ?>
									<a onclick="isagio('<?php echo $ad['id']; ?>')" class="btn btn-primary btn-outline">开启</a>
								<?php endif; ?>
							</td>
							<td class="text-center">
								<?php if($ad['is_pt']==0): ?>
									<a onclick="ispt('<?php echo $ad['id']; ?>')" class="btn btn-primary btn-danger">关闭</a>
								<?php else: ?>
									<a onclick="ispt('<?php echo $ad['id']; ?>')" class="btn btn-primary btn-outline">开启</a>
								<?php endif; ?>
							</td>
							<td class="text-center">
								<?php if($ad['is_jyt']==0): ?>
									<a onclick="isjyt('<?php echo $ad['id']; ?>')" class="btn btn-primary btn-danger">关闭</a>
								<?php else: ?>
									<a onclick="isjyt('<?php echo $ad['id']; ?>')" class="btn btn-primary btn-outline">开启</a>
								<?php endif; ?>
							</td>
							<td class="text-center">
								<?php if($ad['is_ms']==0): ?>
									<a onclick="isms('<?php echo $ad['id']; ?>')" class="btn btn-primary btn-danger">关闭</a>
								<?php else: ?>
									<a onclick="isms('<?php echo $ad['id']; ?>')" class="btn btn-primary btn-outline">开启</a>
								<?php endif; ?>
							</td>
						</tr>
						<?php endforeach; endif; else: echo "" ;endif; ?>
					</tbody>
				</table>
				<div style="text-align: right;">
					<?php echo $list->render(); ?>
				</div>
			</div>
		</div>
	</div>
</div>

				</div>
			</div>
			<!--右侧部分结束-->
		</div>
		<div class="footer">
			<div class="pull-right"> 版权所有 Project &copy; 2017-2020 版权所有</div>
		</div>
		<script src="__JS__/jquery.min.js"></script>
		<script src="__JS__/bootstrap.min.js"></script>
		<script src="__JS__/jquery.metisMenu.js"></script>
		<script src="__JS__/jquery.slimscroll.min.js"></script>
		<script src="__LIB__/layer/layer.js"></script>
		<script src="__JS__/core.min.js"></script>
		<script src="__JS__/pace.min.js"></script>
		<script src="__JS__/autocomplete.js"></script>
		<script>
			// 文件上传URL
			var __UPLOAD_URL__ = "<?php echo url('web/upload/index'); ?>";
			var __CURRENT_URL__ = "<?php echo $current_url; ?>";
			console.log(__CURRENT_URL__);
		</script>
		<script src="__JS__/admin.js"></script>
		<script>
			var show = "<?php echo $is_show_left; ?>";
			if(show == 0) {
				$("body").toggleClass("mini-navbar"), SmoothlyMenu();
			}
		</script>
		<script>
			var top_menu_id = "<?php echo $top_menu_id; ?>";
			$(".lactive").removeClass("lactive");
			if(top_menu_id != "") {
				$("#top_menu" + top_menu_id).addClass("lactive");
			} else {
				$("#shouye").addClass("lactive");
			}
			//交班操作
			function jiaoban1() {
				layer.open({
					type: 2,
					id: "jioaban_list",
					area: ['750px', '350px'],
					title: '收入',
					scrollbar: false,
					content: '/web/index/jiaoban_list' //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
				});
			}

			function jiaoban() {
				$.ajax({
					url: '/web/index/jiaoban_list',
					data: {},
					type: "post",
					success: function(data) {
						var info = data.data;
						var html = '<div class="input-group m-b" style="width:100%;text-align: center;">' +
							'<span style="color: red;font-size: 20px;">￥' +
							'<span id="total_price" style="color: red;font-size: 50px;" class="b_rs_pan">' + info.zsr + '</span></span>' +
							'</br><span>工作时间：' + info.startime + '至' + info.endtime + '</span>' +
							'</div>' +
							'<table class="table table-bordered table-hover">' +
							'<thead>' +
							'<tr class="long-th">' +
							'<th>现金</br>￥' + info.xianjin + '</th>' +
							'<th>银行卡</br>￥' + info.yinhangka + '</th>' +
							'<th>微信</br>￥' + info.weixin + '</th>' +
							'<th>支付宝</br>￥' + info.zhifubao + '</th>' +
							'<th>自定义</br>￥' + info.zidingyi + '</th>' +
							'</tr>' +
							'</thead>' +
							'</table>';
						var index = layer.open({
							title: '确认交班',
							zIndex: "addjb",
							area: ['750px', '300px'],
							content: html,
							btn: ['确定', '取消'],
							yes: function(index, layero) {
								//按钮【按钮一】的回调
								$.ajax({
									url: '/web/index/addjb',
									data: {
										total_icome: info.zsr,
										cash: info.xianjin,
										card_icome: info.yinhangka,
										wx_icome: info.weixin,
										zfb_icome: info.zhifubao,
										zdy_icome: info.zidingyi
									},
									type: "post",
									success: function(data) {
										layer.close(index);
										callback1(data);
									}
								})
							},
							btn2: function(index, layero) {
								layer.close(index);
							}
						});
					}
				});
			}

			function callback1(data) {
				if(data.code == 200) {
					var info = data.data;
					var html = '<div>' +
						'<div style="text-align: center;">' +
						'<i class="fa fa-check" style="color: #35b12c;font-size: 60px;font-weight: 600;"></i>' +
						'<p><span class="b_rs_pan">交班成功</span> </p>' +
						'</div>' +
						'<div class="form-group" style="padding-left: 100px;"><label class="col-sm-5 control-label">交班时间：</label><div class="input-group col-sm-7">' + info.time + '</div></div>' +
						'<div class="form-group" style="padding-left: 100px;"><label class="col-sm-5 control-label">操作员：</label><div class="input-group col-sm-7">' + info.mobile + '</div></div>' +
						'<div class="form-group" style="padding-left: 100px;"><label class="col-sm-5 control-label">收入(元)：</label><div class="input-group col-sm-7">' + info.zsr + '</div></div>' +
						'</div>';
					var index = layer.open({
						title: '交班成功',
						area: ['500px', '350px'],
						content: html,
						btn: ['我知道了'],
						yes: function(index, layero) {
							layer.close(index);
						}
					});

				} else {
					layer.msg(data.msg);
					window.reload();
				}

			}
		</script>
		
<script>
	//疯狂抢
	function isgrab(id){
		layer.open({		
	  	type: 2, 
	  	id: "grabview",
	 	area: ['850px', '400px'] ,
	 	title: '疯狂抢栏目商品设置',
	 	scrollbar: false,
	  	content: '/web/show/grabview?id='+id //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
		}); 
	}
	
	//赚积分
	function isscore(id){
		layer.open({		
	  	type: 2, 
	  	id: "scoreview",
	 	area: ['850px', '400px'] ,
	 	title: '赚积分栏目商品设置',
	 	scrollbar: false,
	  	content: '/web/show/scoreview?id='+id //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
		}); 
	}
	
	//优惠购
	function isagio(id){
		layer.open({		
	  	type: 2, 
	  	id: "agioview",
	 	area: ['850px', '400px'] ,
	 	title: '优惠购栏目商品设置',
	 	scrollbar: false,
	  	content: '/web/show/agioview?id='+id //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
		}); 
	}
	
	//云拼团
	function ispt(id){
		layer.open({		
	  	type: 2, 
	  	id: "ptview",
	 	area: ['850px', '450px'] ,
	 	title: '云拼团栏目商品设置',
	 	scrollbar: false,
	  	content: '/web/show/ptview?id='+id //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
		}); 
	}
	//交友购
	function isjyt(id){
		layer.open({		
	  	type: 2, 
	  	id: "jytview",
	 	area: ['850px', '600px'] ,
	 	title: '交友团栏目商品设置',
	 	scrollbar: false,
	  	content: '/web/show/jytview?id='+id //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
		}); 
	}
	//秒杀
	function isms(id){
		layer.open({		
	  	type: 2, 
	  	id: "msview",
	 	area: ['850px', '400px'] ,
	 	title: '秒杀栏目商品设置',
	 	scrollbar: false,
	  	content: '/web/show/msview?id='+id //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
		}); 
	}
</script>
<style>
	.bank {
		width: 150px;
		height: 30px;
		text-align: center;
		border-radius: 5px;
	}
</style>

	</body>

</html>